package com.lei.design.command.garagedoor;

import com.lei.design.command.Command;

/**
 * @Author LeiXiaoLei
 * @Date 2022/5/20 11:20
 * @Version 1.0
 */
public class GarageDoorCloseCommand implements Command {
    private GarageDoor garageDoor;

    public GarageDoorCloseCommand(GarageDoor garageDoor) {
        this.garageDoor = garageDoor;
    }

    @Override
    public void execute() {
        garageDoor.off();
    }

    @Override
    public void undo() {
        garageDoor.on();
    }
}
